package com.cellulam.framework.scheduled;


import com.cellulam.framework.core.enums.CodeDescriptionFeature;
import com.cellulam.framework.core.utils.EnumHelper;
import lombok.Getter;

/**
 * 处理结果
 */
@Getter
public enum TaskExeResult implements CodeDescriptionFeature {

    /**
     * 已过期
     */
    EXPIRED(1, "已过期"),
    /**
     * 处理失败
     */
    FAIL(2, "处理失败"),
    /**
     * 处理成功
     */
    SUCCESS(3, "处理成功");

    private final int code;
    private final String description;

    TaskExeResult(int code, String description){
        this.code = code;
        this.description = description;
    }

    public static TaskExeResult valueOf(int code){
        return EnumHelper.valueOf(code, TaskExeResult.class);
    }
}
